<?
	global $db, $htmlMenu, $idActive, $do, $prefix_url;	
	
	global $Menu2,$Menu2Link,$SubMenu2,$SubMenu2Link, $lg;
	$SubMenu2 = array();
	$Menu2Link = array();
	$SubMenu2Link = array();
	
	global $db, $lg, $Menu2, $prefix_url, $FullUrl;
	$sql = "select * from categories where pid=697 and showed=1 order by num asc, id asc";
	$Menu2 = $db->getAll($sql);
	
	$sql = "select * from categories where id=697";
	$pro_key = $db->getRow($sql);
	
	$n = count($Menu2);
	
	if($Menu2){
		for($i=0;$i<count($Menu2);$i++){
			$Menu2Link[$i] =  $FullUrl . $prefix_url . $pro_key["unique_key_$lg"] . '/' . $Menu2[$i]["unique_key_$lg"] . "/" ;
			
			if($Menu2[$i]['has_child'] == '1'){
				$sql = "select * from categories where showed=1 and pid=" . $Menu2[$i]['id'] . " order by num asc,id asc";
				$SubMenu2[$i] = $db->getAll($sql);
				$SubMenu2Link[$i] = array();
				$n = count($SubMenu2[$i]);
				for($j=0; $j<$n; $j++){
					$SubMenu2Link[$i][$j] = $FullUrl . $prefix_url . $pro_key["unique_key_$lg"] . '/' . $Menu2[$i]["unique_key_$lg"] . "/" . $SubMenu2[$i][$j]["unique_key_$lg"] . "/";
				}
			}
			else
				if ($Menu2[$i]['id'] == 702) {
					$sql = "select * from products where active=1 and cid=" . $Menu2[$i]['id'] . " order by num asc,id asc";
					$SubMenu2[$i] = $db->getAll($sql);
					$SubMenu2Link[$i] = array();
					$n = count($SubMenu2[$i]);
					for($j=0; $j<$n; $j++){
						$SubMenu2Link[$i][$j] = $FullUrl . $prefix_url . $pro_key["unique_key_$lg"] . '/' . $Menu2[$i]["unique_key_$lg"] . "/" . $SubMenu2[$i][$j]["unique_key_$lg"] . ".html";
					}
				}
				else
					$SubMenu2[$i] = "";
		}
	}
	include(UC_DIR.'LeftCategories.ctp');
?>